using System;
using System.Data.Linq;

namespace RomanJendrusz.Amazon.ETL.Domain
{
    public class CustomerReview
    {
        private EntityRef<Book> book;
#pragma warning disable 649

#pragma warning disable 219
        private string bookAsin;
        private EntityRef<Customer> customer;
#pragma warning restore 219

#pragma warning disable 219
        private string customerId;
        private DateTime updated;
#pragma warning restore 649

        public CustomerReview()
        {
            book = new EntityRef<Book>();
            customer = new EntityRef<Customer>();
        }   
#pragma warning restore 219

        public int CustomerReviewId { get; set; }

        public Book Book
        {
            get { return book.Entity; }
            set
            {
                book.Entity = value;
                if(value!= null)
                bookAsin = value.Asin;
            }
        }

        public Customer Customer
        {
            get { return customer.Entity; }
            set
            {
                customer.Entity = value;
            }
        }


        public short Rating { get; set; }

        public int HelpfulVotes { get; set; }

        public int TotalVotes { get; set; }

        public DateTime AddedDate { get; set; }

        public string Summary { get; set; }

        public string Content { get; set; }

        public DateTime Updated
        {
            get { return updated; }
        }
    }
}